# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=bzr-fastimport
pkgver=0.13.0
pkgrel=1
pkgdesc="Bazaar Fast Import is a plugin providing fast loading of revision control data into Bazaar."
arch=('any')
url="https://launchpad.net/bzr-fastimport"
license=('GPL2')
depends=('bzr' 'python2-fastimport')
source=("https://launchpad.net/${pkgname}/trunk/${pkgver}/+download/${pkgname}-${pkgver}.tar.gz"
        "helpers.patch")
sha256sums=('5e296dc4ff8e9bf1b6447e81fef41e1217656b43368ee4056a1f024221e009eb'
            'aaad5d6621d5cc7ee583b225a0cce5b8fe7696dab565976c5ed0826c8a0840b5')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  # Remove calls to helpers that have been obsoleted in python2-fastimport
  #  - https://bazaar.launchpad.net/~jelmer/python-fastimport/trunk/revision/328
  #  - https://bazaar.launchpad.net/~jelmer/python-fastimport/trunk/revision/327
  patch -Np1 -i "${srcdir}/helpers.patch"
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  python2 setup.py install --root="${pkgdir}" --optimize=1
}
